/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author edilson
 */
@Entity
@Table(name = "Ministra")
@NamedQueries({
    @NamedQuery(name = "Ministra.findAll", query = "SELECT m FROM Ministra m"),
    @NamedQuery(name = "Ministra.findById", query = "SELECT m FROM Ministra m WHERE m.id = :id"),
    @NamedQuery(name = "Ministra.findByProfessorid", query = "SELECT m FROM Ministra m WHERE m.professorid = :professorid"),
    @NamedQuery(name = "Ministra.findByTurmaid", query = "SELECT m FROM Ministra m WHERE m.turmaid = :turmaid")})
public class Ministra implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "Professor_id")
    private int professorid;
    @Basic(optional = false)
    @Column(name = "Turma_id")
    private int turmaid;

    public Ministra() {
    }

    public Ministra(Integer id) {
        this.id = id;
    }

    public Ministra(Integer id, int professorid, int turmaid) {
        this.id = id;
        this.professorid = professorid;
        this.turmaid = turmaid;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public int getProfessorid() {
        return professorid;
    }

    public void setProfessorid(int professorid) {
        this.professorid = professorid;
    }

    public int getTurmaid() {
        return turmaid;
    }

    public void setTurmaid(int turmaid) {
        this.turmaid = turmaid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Ministra)) {
            return false;
        }
        Ministra other = (Ministra) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "model.Ministra[id=" + id + "]";
    }

}
